﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using 简单工厂.War3.Interface;

namespace 简单工厂
{
  public  class ObjectFactory
    {


        private static string IRaceTypeConfigReflection = ConfigurationManager.AppSettings["IRaceTypeConfigReflection"];
        private static string DllName = IRaceTypeConfigReflection.Split(',')[0];
        private static string TypeName = IRaceTypeConfigReflection.Split(',')[1];
        public static IRace CreateInstanceConfigReflection()
        {
            var type = Assembly.Load(DllName).GetType(TypeName);
            //Type type = assembly.GetType(TypeName);
            return (IRace)Activator.CreateInstance(type);
        }
    }
}
